<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>UE4 MySQL插件开发 | Element</title><meta name="keywords" content="UnrealEngine"><meta name="author" content="FHang"><meta name="copyright" content="FHang"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta http-equiv="Cache-Control" content="no-transform"><meta http-equiv="Cache-Control" content="no-siteapp"><meta name="description" content="UE4 MySQL插件开发1. 项目简介 个人UrealEngine MySQL Plugin开发流程 方便UnrealEngine项目链接和操作MySQL数据库  2. 项目环境1234IDE -&gt; JetBrains Rider 2022.1 EAP7 内部版本号 221.4906.10UnrealEngine -&gt; 4.27.2Compiler Environment -&gt;">
<meta property="og:type" content="article">
<meta property="og:title" content="UE4 MySQL插件开发">
<meta property="og:url" content="https://fhangh.gitee.io/article/605bd1ac.html">
<meta property="og:site_name" content="Element">
<meta property="og:description" content="UE4 MySQL插件开发1. 项目简介 个人UrealEngine MySQL Plugin开发流程 方便UnrealEngine项目链接和操作MySQL数据库  2. 项目环境1234IDE -&gt; JetBrains Rider 2022.1 EAP7 内部版本号 221.4906.10UnrealEngine -&gt; 4.27.2Compiler Environment -&gt;">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/Post_Img_mini/postImg_24.jpg">
<meta property="article:published_time" content="2022-03-26T07:56:25.807Z">
<meta property="article:modified_time" content="2022-05-19T04:29:42.988Z">
<meta property="article:author" content="FHang">
<meta property="article:tag" content="UnrealEngine">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/Post_Img_mini/postImg_24.jpg"><link rel="shortcut icon" href="/fhangh/img/fh.png"><link rel="canonical" href="https://fhangh.gitee.io/article/605bd1ac"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><meta name="yandex-verification" content="{&quot;theme_color&quot;:{&quot;enable&quot;:true,&quot;main&quot;:&quot;#49B1F5&quot;,&quot;paginator&quot;:&quot;#00c4b6&quot;,&quot;button_hover&quot;:&quot;#FF7242&quot;,&quot;text_selection&quot;:&quot;#00c4b6&quot;,&quot;link_color&quot;:&quot;#99a9bf&quot;,&quot;meta_color&quot;:&quot;#858585&quot;,&quot;hr_color&quot;:&quot;#A4D8FA&quot;,&quot;code_foreground&quot;:&quot;#F47466&quot;,&quot;code_background&quot;:&quot;rgba(27, 31, 35, .05)&quot;,&quot;toc_color&quot;:&quot;#00c4b6&quot;,&quot;blockquote_padding_color&quot;:&quot;#49b1f5&quot;,&quot;blockquote_background_color&quot;:&quot;#49b1f5&quot;}}"/><link rel="stylesheet" href="/fhangh/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css"><script>var GLOBAL_CONFIG = { 
  root: '/fhangh/',
  algolia: undefined,
  localSearch: {"path":"search.xml","languages":{"hits_empty":"找不到您查询的内容：${query}"}},
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  ClickShowText: undefined,
  lightbox: 'fancybox',
  Snackbar: {"chs_to_cht":"你已切换为繁体","cht_to_chs":"你已切换为简体","day_to_night":"你已切换为深色模式","night_to_day":"你已切换为浅色模式","bgLight":"#49b1f5","bgDark":"#121212","position":"top-right"},
  justifiedGallery: {
    js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
    css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
  },
  isPhotoFigcaption: false,
  islazyload: true,
  isanchor: false
};

var saveToLocal = {
  set: function setWithExpiry(key, value, ttl) {
    const now = new Date()
    const expiryDay = ttl * 86400000
    const item = {
      value: value,
      expiry: now.getTime() + expiryDay,
    }
    localStorage.setItem(key, JSON.stringify(item))
  },

  get: function getWithExpiry(key) {
    const itemStr = localStorage.getItem(key)

    if (!itemStr) {
      return undefined
    }
    const item = JSON.parse(itemStr)
    const now = new Date()

    if (now.getTime() > item.expiry) {
      localStorage.removeItem(key)
      return undefined
    }
    return item.value
  }
}</script><script id="config_change">var GLOBAL_CONFIG_SITE = { 
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2022-05-19 12:29:42'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(function () {  window.activateDarkMode = function () {
    document.documentElement.setAttribute('data-theme', 'dark')
    if (document.querySelector('meta[name="theme-color"]') !== null) {
      document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
    }
  }
  window.activateLightMode = function () {
    document.documentElement.setAttribute('data-theme', 'light')
   if (document.querySelector('meta[name="theme-color"]') !== null) {
      document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
    }
  }
  const autoChangeMode = 'false'
  const t = saveToLocal.get('theme')
  if (autoChangeMode === '1') {
    const isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches
    const isLightMode = window.matchMedia('(prefers-color-scheme: light)').matches
    const isNotSpecified = window.matchMedia('(prefers-color-scheme: no-preference)').matches
    const hasNoSupport = !isDarkMode && !isLightMode && !isNotSpecified
    if (t === undefined) {
      if (isLightMode) activateLightMode()
      else if (isDarkMode) activateDarkMode()
      else if (isNotSpecified || hasNoSupport) {
        const now = new Date()
        const hour = now.getHours()
        const isNight = hour <= 6 || hour >= 18
        isNight ? activateDarkMode() : activateLightMode()
      }
      window.matchMedia('(prefers-color-scheme: dark)').addListener(function (e) {
        if (saveToLocal.get('theme') === undefined) {
          e.matches ? activateDarkMode() : activateLightMode()
        }
      })
    } else if (t === 'light') activateLightMode()
    else activateDarkMode()
  } else if (autoChangeMode === '2') {
    const now = new Date()
    const hour = now.getHours()
    const isNight = hour <= 6 || hour >= 18
    if (t === undefined) isNight ? activateDarkMode() : activateLightMode()
    else if (t === 'light') activateLightMode()
    else activateDarkMode()
  } else {
    if (t === 'dark') activateDarkMode()
    else if (t === 'light') activateLightMode()
  }const asideStatus = saveToLocal.get('aside-status')
if (asideStatus !== undefined) {
   if (asideStatus === 'hide') {
     document.documentElement.classList.add('hide-aside')
   } else {
     document.documentElement.classList.remove('hide-aside')
   }
}})()</script><meta name="generator" content="Hexo 5.3.0"></head><body><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><div class="spinner-box"><div class="configure-border-1"><div class="configure-core"></div></div><div class="configure-border-2"><div class="configure-core"></div></div><div class="loading-word">加载中...</div></div></div><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="author-avatar"><img class="avatar-img" data-lazy-src="/fhangh/img/fh.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/fhangh/archives/"><div class="headline">文章</div><div class="length-num">26</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/fhangh/tags/"><div class="headline">标签</div><div class="length-num">10</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/fhangh/categories/"><div class="headline">分类</div><div class="length-num">4</div></a></div></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/fhangh/"><i class="fa-fw fas fa-home"></i><span> 主页</span></a></div><div class="menus_item"><a class="site-page" href="/fhangh/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/fhangh/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/fhangh/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/fhangh/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/fhangh/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 列表</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page" href="/fhangh/music/"><i class="fa-fw fas fa-music"></i><span> Music</span></a></li><li><a class="site-page" href="/fhangh/movies/"><i class="fa-fw fas fa-video"></i><span> Movie</span></a></li><li><a class="site-page" href="/fhangh/Gallery/"><i class="fa-fw fas fa-images"></i><span> Image</span></a></li></ul></div></div></div></div><div id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url(https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/Post_Img/postImg_24.jpg)"><nav id="nav"><span id="blog_name"><a id="site-name" href="/fhangh/">Element</a></span><span id="menus"><div id="search_button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/fhangh/"><i class="fa-fw fas fa-home"></i><span> 主页</span></a></div><div class="menus_item"><a class="site-page" href="/fhangh/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/fhangh/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/fhangh/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/fhangh/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/fhangh/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 列表</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page" href="/fhangh/music/"><i class="fa-fw fas fa-music"></i><span> Music</span></a></li><li><a class="site-page" href="/fhangh/movies/"><i class="fa-fw fas fa-video"></i><span> Movie</span></a></li><li><a class="site-page" href="/fhangh/Gallery/"><i class="fa-fw fas fa-images"></i><span> Image</span></a></li></ul></div></div><span class="close" id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></span></span></nav><div id="post-info"><h1 class="post-title">UE4 MySQL插件开发</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2022-03-26T07:56:25.807Z" title="发表于 2022-03-26 15:56:25">2022-03-26</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2022-05-19T04:29:42.988Z" title="更新于 2022-05-19 12:29:42">2022-05-19</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/fhangh/categories/UnrealEngine/">UnrealEngine</a></span></div><div class="meta-secondline"> <span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">字数总计:</span><span class="word-count">2.1k</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>10分钟</span></span><span class="post-meta-separator">|</span><span class="post-meta-pv-cv"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h1 id="UE4-MySQL插件开发"><a href="#UE4-MySQL插件开发" class="headerlink" title="UE4 MySQL插件开发"></a>UE4 MySQL插件开发</h1><h3 id="1-项目简介"><a href="#1-项目简介" class="headerlink" title="1. 项目简介"></a>1. 项目简介</h3><ul>
<li>个人<code>UrealEngine MySQL Plugin</code>开发流程</li>
<li>方便<code>UnrealEngine</code>项目<code>链接</code>和<code>操作</code>MySQL数据库</li>
</ul>
<h3 id="2-项目环境"><a href="#2-项目环境" class="headerlink" title="2. 项目环境"></a>2. 项目环境</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">IDE -&gt; JetBrains Rider 2022.1 EAP7 内部版本号 221.4906.10</span><br><span class="line">UnrealEngine -&gt; 4.27.2</span><br><span class="line">Compiler Environment -&gt; Visual Studio 2022 提供编译组件</span><br><span class="line">MySQL -&gt; 8.0.28 MySQL Community Server - GPL</span><br></pre></td></tr></table></figure>




<h3 id="3-项目资源"><a href="#3-项目资源" class="headerlink" title="3. 项目资源"></a>3. 项目资源</h3><h4 id="3-1-资源文件结构"><a href="#3-1-资源文件结构" class="headerlink" title="3.1 资源文件结构"></a>3.1 资源文件结构</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">ConnectorLibs</span><br><span class="line">	- ConnectorLibs</span><br><span class="line">		+ include</span><br><span class="line">		+ lib</span><br><span class="line">	- ConnectorLibs.Build.cs</span><br></pre></td></tr></table></figure>




<h4 id="3-2-资源链接"><a href="#3-2-资源链接" class="headerlink" title="3.2 资源链接"></a>3.2 资源链接</h4><p>「ConnectorLibs」<a target="_blank" rel="noopener" href="https://www.aliyundrive.com/s/wTrvzpVdfxU">https://www.aliyundrive.com/s/wTrvzpVdfxU</a> 提取码: 0be0</p>
<h3 id="4-项目创建"><a href="#4-项目创建" class="headerlink" title="4. 项目创建"></a>4. 项目创建</h3><h4 id="4-1-创建UE4项目"><a href="#4-1-创建UE4项目" class="headerlink" title="4.1 创建UE4项目"></a>4.1 创建UE4项目</h4><ol>
<li>默认选择<code>游戏项目</code></li>
<li>默认选择<code>空项目</code></li>
<li>创建<code>C++项目</code>，包含<code>初学者内容包</code></li>
<li>选择项目的创建目录</li>
<li>创建项目名<code>FH_TestMySQL</code></li>
</ol>
<h4 id="4-2-创建新插件"><a href="#4-2-创建新插件" class="headerlink" title="4.2 创建新插件"></a>4.2 创建新插件</h4><ol>
<li>找到<code>Edit</code>或<code>Settings</code></li>
<li>选择<code>plugins</code>进入插件界面</li>
<li>选择<code>New Plugin</code></li>
<li>选择<code>Blank</code></li>
<li>设置插件名称<code>FH_MySQL</code></li>
<li><code>Descriptor Data</code>随意填写</li>
<li><code>Create Plugin</code></li>
</ol>
<h4 id="4-3-创建MySQL-C-类"><a href="#4-3-创建MySQL-C-类" class="headerlink" title="4.3 创建MySQL C++类"></a>4.3 创建MySQL C++类</h4><h5 id="4-3-1-FH-ConnectionObject"><a href="#4-3-1-FH-ConnectionObject" class="headerlink" title="4.3.1 FH_ConnectionObject"></a>4.3.1 FH_ConnectionObject</h5><ol>
<li>创建<code>Object</code>C++类，类名<code>FH_ConnectionObject</code></li>
<li>选择添加到插件目录<code>FH_MySQL(Runtime)</code>，默认<code>public .h，private .cpp</code></li>
<li><code>Create Class</code></li>
<li>会弹出一个<code>Message</code>窗口，内容大致为<code>创建成功，但需要重新编译</code>，选择<code>No</code></li>
</ol>
<h5 id="4-3-2-BPFuncLib-FHSQL"><a href="#4-3-2-BPFuncLib-FHSQL" class="headerlink" title="4.3.2 BPFuncLib_FHSQL"></a>4.3.2 BPFuncLib_FHSQL</h5><ol>
<li>创建<code>Blueprint Function Library</code>C++类，类名<code>BPFuncLib_FHSQL</code></li>
<li>剩下步骤同上</li>
</ol>
<h3 id="5-项目配置"><a href="#5-项目配置" class="headerlink" title="5. 项目配置"></a>5. 项目配置</h3><h4 id="5-1-引入MySQL环境库"><a href="#5-1-引入MySQL环境库" class="headerlink" title="5.1 引入MySQL环境库"></a>5.1 引入MySQL环境库</h4><h5 id="5-1-1-导入环境库"><a href="#5-1-1-导入环境库" class="headerlink" title="5.1.1 导入环境库"></a>5.1.1 导入环境库</h5><ol>
<li>准备好<code>ConnectorLibs</code></li>
<li>来到<code>FH_TestMySQL\Plugins\FH_MySQL\Source</code>目录下</li>
<li>创建目录<code>ThirdParty</code></li>
<li>将<code>ConnectorLibs</code>放入<code>ThirdParty</code>内</li>
</ol>
<h5 id="5-1-2-配置项目属性"><a href="#5-1-2-配置项目属性" class="headerlink" title="5.1.2 配置项目属性"></a>5.1.2 配置项目属性</h5><ol>
<li><code>Rider</code>打开创建好的UE4 C++项目</li>
<li>在资源栏内找到项目名<code>FH_TestMySQL</code>，在<code>Games</code>目录下</li>
<li>右键，选择<code>Properties</code></li>
<li>在<code>Configurations</code>内选择<code>Development_Editor | x64</code></li>
<li>选择<code>VC++目录</code></li>
<li>在<code>包含目录(include)</code>中填入绝对路径<code>项目文件路径\FH_TestMySQL\Plugins\FH_MySQL\Source\ThirdParty\ConnectorLibs\include</code></li>
<li>在<code>库目录(lib)</code>中填入绝对路径<code>项目文件路径\FH_TestMySQL\Plugins\FH_MySQL\Source\ThirdParty\ConnectorLibs\lib</code></li>
<li><code>OK</code></li>
</ol>
<h5 id="5-1-3-配置项目文件"><a href="#5-1-3-配置项目文件" class="headerlink" title="5.1.3 配置项目文件"></a>5.1.3 配置项目文件</h5><ol>
<li><p>修改<code>FH_MySQL.uplugin</code>，文件位置<code>项目文件路径\FH_TestMySQL\Plugins\FH_MySQL</code>，只需要添加<code>&quot;WhitelistPlatforms&quot;: [&quot;Win64&quot;]</code></p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">	<span class="attr">&quot;FileVersion&quot;</span>: <span class="number">3</span>,</span><br><span class="line">	<span class="attr">&quot;Version&quot;</span>: <span class="number">1</span>,</span><br><span class="line">	<span class="attr">&quot;VersionName&quot;</span>: <span class="string">&quot;1.0&quot;</span>,</span><br><span class="line">	<span class="attr">&quot;FriendlyName&quot;</span>: <span class="string">&quot;FH_MySQL&quot;</span>,</span><br><span class="line">	<span class="attr">&quot;Description&quot;</span>: <span class="string">&quot;Using UE4 Connecting MySQL Plugin&quot;</span>,</span><br><span class="line">	<span class="attr">&quot;Category&quot;</span>: <span class="string">&quot;FhPlugin&quot;</span>,</span><br><span class="line">	<span class="attr">&quot;CreatedBy&quot;</span>: <span class="string">&quot;FangH&quot;</span>,</span><br><span class="line">	<span class="attr">&quot;CreatedByURL&quot;</span>: <span class="string">&quot;https://fhangh.gitee.io/&quot;</span>,</span><br><span class="line">	<span class="attr">&quot;DocsURL&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">	<span class="attr">&quot;MarketplaceURL&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">	<span class="attr">&quot;SupportURL&quot;</span>: <span class="string">&quot;&quot;</span>,</span><br><span class="line">	<span class="attr">&quot;CanContainContent&quot;</span>: <span class="literal">true</span>,</span><br><span class="line">	<span class="attr">&quot;IsBetaVersion&quot;</span>: <span class="literal">true</span>,</span><br><span class="line">	<span class="attr">&quot;IsExperimentalVersion&quot;</span>: <span class="literal">false</span>,</span><br><span class="line">	<span class="attr">&quot;Installed&quot;</span>: <span class="literal">false</span>,</span><br><span class="line">	<span class="attr">&quot;Modules&quot;</span>: [</span><br><span class="line">		&#123;</span><br><span class="line">			<span class="attr">&quot;Name&quot;</span>: <span class="string">&quot;FH_MySQL&quot;</span>,</span><br><span class="line">			<span class="attr">&quot;Type&quot;</span>: <span class="string">&quot;Runtime&quot;</span>,</span><br><span class="line">			<span class="attr">&quot;LoadingPhase&quot;</span>: <span class="string">&quot;Default&quot;</span>,</span><br><span class="line">			<span class="attr">&quot;WhitelistPlatforms&quot;</span>: [<span class="string">&quot;Win64&quot;</span>]</span><br><span class="line">		&#125;</span><br><span class="line">	]</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></li>
<li><p>修改<code>FH_MySQL.Build.cs</code>，文件位置<code>项目文件路径\FH_TestMySQL\Plugins\FH_MySQL\Source\FH_MySQL</code>，修改如下内容</p>
<figure class="highlight c#"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">PublicDependencyModuleNames.AddRange(</span><br><span class="line">	<span class="keyword">new</span> <span class="built_in">string</span>[]</span><br><span class="line">    &#123;</span><br><span class="line">		<span class="string">&quot;Core&quot;</span>,</span><br><span class="line">		<span class="string">&quot;ConnectorLibs&quot;</span>,</span><br><span class="line">		<span class="comment">// ... add other public dependencies that you statically link with here ...</span></span><br><span class="line">	&#125;</span><br><span class="line">);</span><br></pre></td></tr></table></figure>




</li>
</ol>
<h3 id="6-MySQL-C-文件"><a href="#6-MySQL-C-文件" class="headerlink" title="6. MySQL C++文件"></a>6. MySQL C++文件</h3><h4 id="6-1-MySQL连接对象"><a href="#6-1-MySQL连接对象" class="headerlink" title="6.1 MySQL连接对象"></a>6.1 MySQL连接对象</h4><ul>
<li><p><code>FH_ConnectionObject.h</code></p>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="meta-keyword">pragma</span> once</span></span><br><span class="line"></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&quot;CoreMinimal.h&quot;</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&quot;UObject/NoExportTypes.h&quot;</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&quot;mysql.h&quot;</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&quot;FH_ConnectionObject.generated.h&quot;</span></span></span><br><span class="line"></span><br><span class="line">UCLASS(BlueprintType)</span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">FH_MYSQL_API</span> <span class="title">UFH_ConnectionObject</span> :</span> <span class="keyword">public</span> UObject</span><br><span class="line">&#123;</span><br><span class="line">	GENERATED_BODY()</span><br><span class="line"></span><br><span class="line"><span class="keyword">private</span>:</span><br><span class="line">	UFH_ConnectionObject();</span><br><span class="line"></span><br><span class="line"><span class="keyword">public</span>:</span><br><span class="line">	MYSQL *Fh_ConnMysql;</span><br><span class="line">&#125;;</span><br></pre></td></tr></table></figure></li>
<li><p><code>FH_ConnectionObject.cpp</code></p>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&quot;FH_ConnectionObject.h&quot;</span></span></span><br><span class="line"></span><br><span class="line">UFH_ConnectionObject::UFH_ConnectionObject()</span><br><span class="line">&#123;</span><br><span class="line">	Fh_ConnMysql = <span class="literal">nullptr</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>




</li>
</ul>
<h4 id="6-2-MySQL函数工具库"><a href="#6-2-MySQL函数工具库" class="headerlink" title="6.2 MySQL函数工具库"></a>6.2 MySQL函数工具库</h4><ul>
<li><p><code>BPFuncLib_FHSQL.h</code></p>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="meta-keyword">pragma</span> once</span></span><br><span class="line"></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&quot;CoreMinimal.h&quot;</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&quot;Kismet/BlueprintFunctionLibrary.h&quot;</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&quot;FH_ConnectionObject.h&quot;</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&quot;BPFuncLib_FHSQL.generated.h&quot;</span></span></span><br><span class="line"></span><br><span class="line">USTRUCT(BlueprintType)</span><br><span class="line"><span class="class"><span class="keyword">struct</span> <span class="title">FQueryResultRow</span></span></span><br><span class="line"><span class="class">&#123;</span></span><br><span class="line">	GENERATED_BODY()</span><br><span class="line"></span><br><span class="line">	UPROPERTY(BlueprintReadWrite, Category=<span class="string">&quot;MySQL|Result Row Value&quot;</span>)</span><br><span class="line">	TArray&lt;FString&gt; RowValue;</span><br><span class="line">&#125;;</span><br><span class="line"></span><br><span class="line">USTRUCT(BlueprintType)</span><br><span class="line"><span class="class"><span class="keyword">struct</span> <span class="title">FQueryResultRows</span></span></span><br><span class="line"><span class="class">&#123;</span></span><br><span class="line">	GENERATED_BODY()</span><br><span class="line"></span><br><span class="line">	UPROPERTY(BlueprintReadWrite, Category=<span class="string">&quot;MySQL|Result Rows Value&quot;</span>)</span><br><span class="line">	TArray&lt;FQueryResultRow&gt; RowsValue;</span><br><span class="line">&#125;;</span><br><span class="line"></span><br><span class="line">UCLASS(BlueprintType)</span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">FH_MYSQL_API</span> <span class="title">UBPFuncLib_FHSQL</span> :</span> <span class="keyword">public</span> UBlueprintFunctionLibrary</span><br><span class="line">&#123;</span><br><span class="line">	GENERATED_BODY()</span><br><span class="line"></span><br><span class="line"><span class="keyword">public</span>:</span><br><span class="line">	<span class="comment">/*</span></span><br><span class="line"><span class="comment">	 * Connection == MySQL Object</span></span><br><span class="line"><span class="comment">	 * @return *UFH_ConnectionObject == MySQL Connector</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	UFUNCTION(BlueprintCallable, Category=<span class="string">&quot;MySQL|Utils&quot;</span>)</span><br><span class="line">	<span class="function"><span class="keyword">static</span> UFH_ConnectionObject *<span class="title">ConnectToMySQL</span><span class="params">(FString Host, FString UserName, FString PassWord, FString DBName,</span></span></span><br><span class="line"><span class="function"><span class="params">												int32 Port, FString &amp;ConnectMessage)</span></span>;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/*</span></span><br><span class="line"><span class="comment">	 * ConnectionObject == MySQL Object</span></span><br><span class="line"><span class="comment">	 * @return bool == ConnectionState</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	UFUNCTION(BlueprintCallable, Category=<span class="string">&quot;MySQL|Utils&quot;</span>)</span><br><span class="line">	<span class="function"><span class="keyword">static</span> <span class="keyword">bool</span> <span class="title">GetConnectionState</span><span class="params">(UFH_ConnectionObject *ConnectionObject)</span></span>;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/*</span></span><br><span class="line"><span class="comment">	 * ConnectionObject == MySQL Object</span></span><br><span class="line"><span class="comment">	 * @return bool == ConnectionState</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	UFUNCTION(BlueprintCallable, Category=<span class="string">&quot;MySQL|Utils&quot;</span>)</span><br><span class="line">	<span class="function"><span class="keyword">static</span> <span class="keyword">bool</span> <span class="title">CloseConnection</span><span class="params">(UFH_ConnectionObject *ConnectionObject)</span></span>;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/*</span></span><br><span class="line"><span class="comment">	 * ConnectionObject == MySQL Object</span></span><br><span class="line"><span class="comment">	 * @return bool == Insert, Update, Delete Data Is Succeed Or Failed</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	UFUNCTION(BlueprintCallable, Category=<span class="string">&quot;MySQL|Utils&quot;</span>)</span><br><span class="line">	<span class="function"><span class="keyword">static</span> <span class="keyword">bool</span> <span class="title">ActionOnTableData</span><span class="params">(UFH_ConnectionObject *ConnectionObject, FString SqlQuery)</span></span>;</span><br><span class="line">	</span><br><span class="line">	<span class="comment">/*</span></span><br><span class="line"><span class="comment">	 * TableName = DataBase TableName</span></span><br><span class="line"><span class="comment">	 * InsertValues = MySQL Insert Values to Table</span></span><br><span class="line"><span class="comment">	 * @return FString = MySQL Insert Query -&gt; Insert</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	UFUNCTION(BlueprintPure, Category=<span class="string">&quot;MySQL|Utils&quot;</span>)</span><br><span class="line">	<span class="function"><span class="keyword">static</span> FString <span class="title">InsertFormatSqlQuery</span><span class="params">(FString TableName, FString InsertValues)</span></span>;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/*</span></span><br><span class="line"><span class="comment">	 * TableName = DataBase TableName</span></span><br><span class="line"><span class="comment">	 * RowName = Need Update Row</span></span><br><span class="line"><span class="comment">	 * @return FString = MySQL Update Query -&gt; Update</span></span><br><span class="line"><span class="comment">	 */</span>	</span><br><span class="line">	UFUNCTION(BlueprintPure, Category=<span class="string">&quot;MySQL|Utils&quot;</span>)</span><br><span class="line">	<span class="function"><span class="keyword">static</span> FString <span class="title">UpdateAllFormatSqlQuery</span><span class="params">(FString TableName, FString RowName, FString UpdateValue)</span></span>;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/*</span></span><br><span class="line"><span class="comment">	 * TableName = DataBase TableName</span></span><br><span class="line"><span class="comment">	 * RowName = Need Update Row</span></span><br><span class="line"><span class="comment">	 * WhereName = Update Where</span></span><br><span class="line"><span class="comment">	 * WhereSymbol = Operator Or Symbol</span></span><br><span class="line"><span class="comment">	 * WhereValue = Condition Name</span></span><br><span class="line"><span class="comment">	 * UpdateValue = Need Update Date Value</span></span><br><span class="line"><span class="comment">	 * @return FString = MySQL Update Query -&gt; Update</span></span><br><span class="line"><span class="comment">	 */</span>	</span><br><span class="line">	UFUNCTION(BlueprintPure, Category=<span class="string">&quot;MySQL|Utils&quot;</span>)</span><br><span class="line">	<span class="function"><span class="keyword">static</span> FString <span class="title">UpdateByWhereFormatSqlQuery</span><span class="params">(FString TableName, FString RowName, FString WhereName, FString WhereSymbol, FString WhereValue, FString UpdateValue)</span></span>;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/*</span></span><br><span class="line"><span class="comment">	 * TableName = DataBase TableName</span></span><br><span class="line"><span class="comment">	 * @return FString = MySQL Delete Query -&gt; Delete</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	UFUNCTION(BlueprintPure, Category=<span class="string">&quot;MySQL|Utils&quot;</span>)</span><br><span class="line">	<span class="function"><span class="keyword">static</span> FString <span class="title">DeleteAllFormatSqlQuery</span><span class="params">(FString TableName)</span></span>;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/*</span></span><br><span class="line"><span class="comment">	 * TableName = DataBase TableName</span></span><br><span class="line"><span class="comment">	 * WhereName = Update Where</span></span><br><span class="line"><span class="comment">	 * WhereSymbol = Operator Or Symbol</span></span><br><span class="line"><span class="comment">	 * WhereValue = Condition Name</span></span><br><span class="line"><span class="comment">	 * @return FString = MySQL Delete Query -&gt; Delete</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	UFUNCTION(BlueprintPure, Category=<span class="string">&quot;MySQL|Utils&quot;</span>)</span><br><span class="line">	<span class="function"><span class="keyword">static</span> FString <span class="title">DeleteByWhereFormatSqlQuery</span><span class="params">(FString TableName, FString WhereName, FString WhereSymbol, FString WhereValue)</span></span>;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/*</span></span><br><span class="line"><span class="comment">	 * ConnectionObject == MySQL Object</span></span><br><span class="line"><span class="comment">	 * @return bool == Select Data Is Succeed Or Failed</span></span><br><span class="line"><span class="comment">	 */</span>	</span><br><span class="line">	UFUNCTION(BlueprintCallable, Category=<span class="string">&quot;MySQL|Utils&quot;</span>)</span><br><span class="line">	<span class="function"><span class="keyword">static</span> <span class="keyword">bool</span> <span class="title">SelectOnTableData</span><span class="params">(UFH_ConnectionObject *ConnectionObject, FString SqlQuery, FQueryResultRows &amp;ResultRows)</span></span>;</span><br><span class="line">	</span><br><span class="line">	<span class="comment">/*</span></span><br><span class="line"><span class="comment">	 * TableName = DataBase TableName</span></span><br><span class="line"><span class="comment">	 * @return FString = MySQL Select Query -&gt; Select</span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	UFUNCTION(BlueprintPure, Category=<span class="string">&quot;MySQL|Utils&quot;</span>)</span><br><span class="line">	<span class="function"><span class="keyword">static</span> FString <span class="title">SelectAllFormatSqlQuery</span><span class="params">(FString TableName)</span></span>;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/*</span></span><br><span class="line"><span class="comment">	 * TableName = DataBase TableName</span></span><br><span class="line"><span class="comment">	 * @return FString = MySQL Select Query -&gt; Select</span></span><br><span class="line"><span class="comment">	 */</span>	</span><br><span class="line">	UFUNCTION(BlueprintPure, Category=<span class="string">&quot;MySQL|Utils&quot;</span>)</span><br><span class="line">	<span class="function"><span class="keyword">static</span> FString <span class="title">SelectByColumnsFormatSqlQuery</span><span class="params">(FString TableName, FString Columns)</span></span>;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/*</span></span><br><span class="line"><span class="comment">	 * TableName = DataBase TableName</span></span><br><span class="line"><span class="comment">	 * @return TArray&lt;FString&gt; = Get All Rows -&gt; In All Columns Values</span></span><br><span class="line"><span class="comment">	 */</span>		</span><br><span class="line">	UFUNCTION(BlueprintPure, Category=<span class="string">&quot;MySQL|Utils&quot;</span>)</span><br><span class="line">	<span class="function"><span class="keyword">static</span> FQueryResultRow <span class="title">GetRowByIndex</span><span class="params">(<span class="keyword">const</span> FQueryResultRows &amp;ResultRows, int32 RowIndex)</span></span>;</span><br><span class="line">&#125;;</span><br></pre></td></tr></table></figure></li>
<li><p><code>BPFuncLib_FHSQL.cpp</code></p>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&quot;BPFuncLib_FHSQL.h&quot;</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&quot;mysql.h&quot;</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&lt;string&gt;</span></span></span><br><span class="line"></span><br><span class="line"><span class="function">UFH_ConnectionObject* <span class="title">UBPFuncLib_FHSQL::ConnectToMySQL</span><span class="params">(FString Host, FString UserName, FString PassWord, FString DBName,</span></span></span><br><span class="line"><span class="function"><span class="params">	int32 Port, FString &amp;ConnectMessage)</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">	<span class="function"><span class="keyword">const</span> <span class="built_in">std</span>::<span class="built_in">string</span> <span class="title">m_Host</span><span class="params">(TCHAR_TO_UTF8(*Host))</span></span>;</span><br><span class="line">	<span class="function"><span class="keyword">const</span> <span class="built_in">std</span>::<span class="built_in">string</span> <span class="title">m_UserName</span><span class="params">(TCHAR_TO_UTF8(*UserName))</span></span>;</span><br><span class="line">	<span class="function"><span class="keyword">const</span> <span class="built_in">std</span>::<span class="built_in">string</span> <span class="title">m_PassWord</span><span class="params">(TCHAR_TO_UTF8(*PassWord))</span></span>;</span><br><span class="line">	<span class="function"><span class="keyword">const</span> <span class="built_in">std</span>::<span class="built_in">string</span> <span class="title">m_DBName</span><span class="params">(TCHAR_TO_UTF8(*DBName))</span></span>;</span><br><span class="line">	<span class="keyword">const</span> uint32 m_Port = Port; </span><br><span class="line"></span><br><span class="line">	<span class="comment">// Create MySQL Connection Object</span></span><br><span class="line">	UFH_ConnectionObject *ConnectionObject = NewObject&lt;UFH_ConnectionObject&gt;();</span><br><span class="line">	<span class="comment">// Init DataBase Connection Object</span></span><br><span class="line">	ConnectionObject-&gt;Fh_ConnMysql = mysql_init(<span class="literal">nullptr</span>);</span><br><span class="line"></span><br><span class="line">	<span class="comment">// Judge Connection Status And Return ConnectMessage</span></span><br><span class="line">	<span class="keyword">if</span> (mysql_real_connect(ConnectionObject-&gt;Fh_ConnMysql, m_Host.c_str(), m_UserName.c_str(), m_PassWord.c_str(),</span><br><span class="line">	                       m_DBName.c_str(), m_Port, <span class="literal">nullptr</span>, <span class="number">0</span>))</span><br><span class="line">	&#123;</span><br><span class="line">		ConnectMessage = TEXT(<span class="string">&quot;Connect Succeed&quot;</span>);</span><br><span class="line">	&#125;</span><br><span class="line">	<span class="keyword">else</span></span><br><span class="line">	&#123;</span><br><span class="line">		ConnectMessage = TEXT(<span class="string">&quot;Connect Failed&quot;</span>);</span><br><span class="line">	&#125;</span><br><span class="line"></span><br><span class="line">	<span class="comment">// Return MySQL Connection Object</span></span><br><span class="line">	<span class="keyword">return</span> ConnectionObject;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">bool</span> <span class="title">UBPFuncLib_FHSQL::GetConnectionState</span><span class="params">(UFH_ConnectionObject* ConnectionObject)</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">	<span class="comment">// Judge Current MySQL Connection State</span></span><br><span class="line">	<span class="keyword">if</span> (ConnectionObject)</span><br><span class="line">	&#123;</span><br><span class="line">		<span class="keyword">if</span> (ConnectionObject-&gt;Fh_ConnMysql != <span class="literal">nullptr</span>)</span><br><span class="line">		&#123;</span><br><span class="line">			<span class="keyword">return</span> <span class="literal">true</span>;</span><br><span class="line">		&#125;</span><br><span class="line">		<span class="keyword">return</span> <span class="literal">false</span>;</span><br><span class="line">	&#125;</span><br><span class="line">	<span class="keyword">return</span> <span class="literal">false</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">bool</span> <span class="title">UBPFuncLib_FHSQL::CloseConnection</span><span class="params">(UFH_ConnectionObject* ConnectionObject)</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">	<span class="comment">// If MySQL Connected -&gt; Close MySQL Connection; Return True</span></span><br><span class="line">	<span class="comment">// Else -&gt; Return True</span></span><br><span class="line">	<span class="keyword">if</span> (GetConnectionState(ConnectionObject))</span><br><span class="line">	&#123;</span><br><span class="line">		mysql_close(ConnectionObject-&gt;Fh_ConnMysql);</span><br><span class="line">		ConnectionObject-&gt;Fh_ConnMysql = <span class="literal">nullptr</span>;</span><br><span class="line">		ConnectionObject = <span class="literal">nullptr</span>;</span><br><span class="line">		<span class="keyword">return</span> <span class="literal">true</span>;</span><br><span class="line">	&#125;</span><br><span class="line">	<span class="keyword">return</span> <span class="literal">true</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">bool</span> <span class="title">UBPFuncLib_FHSQL::ActionOnTableData</span><span class="params">(UFH_ConnectionObject* ConnectionObject, FString SqlQuery)</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">	<span class="function"><span class="keyword">const</span> <span class="built_in">std</span>::<span class="built_in">string</span> <span class="title">m_SqlQuery</span><span class="params">(TCHAR_TO_UTF8(*SqlQuery))</span></span>;</span><br><span class="line"></span><br><span class="line">	<span class="comment">// Judge MySQL Is Connected</span></span><br><span class="line">	<span class="keyword">if</span> (!ConnectionObject)</span><br><span class="line">	&#123;</span><br><span class="line">		<span class="keyword">return</span> <span class="literal">false</span>;</span><br><span class="line">	&#125;</span><br><span class="line">	<span class="comment">// Judge SqlQuery Is Apply Succeed</span></span><br><span class="line">	<span class="keyword">if</span> (mysql_query(ConnectionObject-&gt;Fh_ConnMysql, m_SqlQuery.c_str()) == <span class="number">0</span>)</span><br><span class="line">	&#123;</span><br><span class="line">		<span class="keyword">return</span> <span class="literal">true</span>;</span><br><span class="line">	&#125;</span><br><span class="line">	<span class="keyword">return</span> <span class="literal">true</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function">FString <span class="title">UBPFuncLib_FHSQL::InsertFormatSqlQuery</span><span class="params">(FString TableName, FString InsertValues)</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">	<span class="comment">// INSERT INTO TableName VALUES(InsertValues);</span></span><br><span class="line">	FString SqlQuery = <span class="string">&quot;INSERT INTO &quot;</span> + TableName + <span class="string">&quot; VALUES(&quot;</span> + InsertValues + <span class="string">&quot;);&quot;</span>;</span><br><span class="line">	<span class="keyword">return</span> SqlQuery;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function">FString <span class="title">UBPFuncLib_FHSQL::UpdateAllFormatSqlQuery</span><span class="params">(FString TableName, FString UpdateRowName, FString UpdateValue)</span></span></span><br><span class="line"><span class="function"></span>&#123;	<span class="comment">// UPDATE TableName SET RowName=UpdateValue;</span></span><br><span class="line">	FString SqlQuery = <span class="string">&quot;UPDATE &quot;</span> + TableName + <span class="string">&quot; SET &quot;</span> + UpdateRowName + <span class="string">&quot;=&quot;</span> + UpdateValue + <span class="string">&quot;;&quot;</span>;</span><br><span class="line">	<span class="keyword">return</span> SqlQuery;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function">FString <span class="title">UBPFuncLib_FHSQL::UpdateByWhereFormatSqlQuery</span><span class="params">(FString TableName, FString UpdateRowName, FString WhereName, FString WhereSymbol, FString WhereValue, FString UpdateValue)</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">	<span class="comment">// UPDATE TableName SET UpdateRowName=UpdateValue WHERE WhereName=WhereValue;</span></span><br><span class="line">	FString SqlQuery = <span class="string">&quot;UPDATE &quot;</span> + TableName + <span class="string">&quot; SET &quot;</span> + UpdateRowName + <span class="string">&quot;=&quot;</span> + UpdateValue + <span class="string">&quot; WHERE &quot;</span> + WhereName + WhereSymbol + WhereValue + <span class="string">&quot;;&quot;</span>;</span><br><span class="line">	<span class="keyword">return</span> SqlQuery;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function">FString <span class="title">UBPFuncLib_FHSQL::DeleteAllFormatSqlQuery</span><span class="params">(FString TableName)</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">	<span class="comment">// DELETE FROM TableName;</span></span><br><span class="line">	FString SqlQuery = <span class="string">&quot;DELETE FROM &quot;</span> + TableName + <span class="string">&quot;;&quot;</span>;</span><br><span class="line">	<span class="keyword">return</span> SqlQuery;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function">FString <span class="title">UBPFuncLib_FHSQL::DeleteByWhereFormatSqlQuery</span><span class="params">(FString TableName, FString WhereName, FString WhereSymbol, FString WhereValue)</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">	<span class="comment">// DELETE FROM TableName WHERE WhereName=‘WhereValue’;</span></span><br><span class="line">	FString SqlQuery = <span class="string">&quot;DELETE FROM &quot;</span> + TableName + <span class="string">&quot; WHERE &quot;</span> + WhereName + WhereSymbol + <span class="string">&quot;&#x27;&quot;</span> + WhereValue + <span class="string">&quot;&#x27;;&quot;</span>;</span><br><span class="line">	<span class="keyword">return</span> SqlQuery;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">bool</span> <span class="title">UBPFuncLib_FHSQL::SelectOnTableData</span><span class="params">(UFH_ConnectionObject* ConnectionObject, FString SqlQuery, FQueryResultRows &amp;ResultRows)</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">	MYSQL_RES *m_Res = <span class="literal">nullptr</span>;</span><br><span class="line">	MYSQL_ROW m_Column;</span><br><span class="line">	TArray&lt;FString&gt; m_ColumnNames;</span><br><span class="line">	FQueryResultRows m_Rows;</span><br><span class="line">	<span class="function"><span class="keyword">const</span> <span class="built_in">std</span>::<span class="built_in">string</span> <span class="title">m_SqlQuery</span><span class="params">(TCHAR_TO_UTF8(*SqlQuery))</span></span>;</span><br><span class="line"></span><br><span class="line">	<span class="keyword">if</span> (!ConnectionObject)&#123;<span class="keyword">return</span> <span class="literal">false</span>;&#125;</span><br><span class="line">	<span class="keyword">if</span> (!ConnectionObject-&gt;Fh_ConnMysql)&#123;<span class="keyword">return</span> <span class="literal">false</span>;&#125;</span><br><span class="line"></span><br><span class="line">	<span class="keyword">if</span> (!mysql_query(ConnectionObject-&gt;Fh_ConnMysql, m_SqlQuery.c_str()))</span><br><span class="line">	&#123;</span><br><span class="line">		ResultRows = &#123;&#125;;</span><br><span class="line">		m_Res = mysql_store_result(ConnectionObject-&gt;Fh_ConnMysql);</span><br><span class="line">		<span class="keyword">const</span> <span class="keyword">int</span> m_Columns = mysql_num_fields(m_Res);</span><br><span class="line"></span><br><span class="line">		<span class="keyword">while</span> ((m_Column = mysql_fetch_row(m_Res)) != <span class="literal">nullptr</span>)</span><br><span class="line">		&#123;</span><br><span class="line">			FQueryResultRow m_Row;</span><br><span class="line">			<span class="keyword">for</span> (<span class="keyword">int</span> i = <span class="number">0</span>; i &lt; m_Columns; ++i)</span><br><span class="line">			&#123;</span><br><span class="line">				m_Row.RowValue.Add(UTF8_TO_TCHAR(m_Column[i]));</span><br><span class="line">			&#125;</span><br><span class="line">			ResultRows.RowsValue.Add(m_Row);</span><br><span class="line">		&#125;</span><br><span class="line">	&#125;</span><br><span class="line">	</span><br><span class="line">	mysql_free_result(m_Res);</span><br><span class="line">	<span class="keyword">return</span> <span class="literal">true</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function">FString <span class="title">UBPFuncLib_FHSQL::SelectAllFormatSqlQuery</span><span class="params">(FString TableName)</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">	<span class="comment">// SELECT * FROM TableName;</span></span><br><span class="line">	FString SqlQuery = <span class="string">&quot;SELECT * FROM &quot;</span> + TableName + <span class="string">&quot;;&quot;</span>;</span><br><span class="line">	<span class="keyword">return</span> SqlQuery;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function">FString <span class="title">UBPFuncLib_FHSQL::SelectByColumnsFormatSqlQuery</span><span class="params">(FString TableName, FString Columns)</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">	<span class="comment">// SELECT CustomerName, City, Country FROM Customers;</span></span><br><span class="line">	FString SqlQuery = <span class="string">&quot;SELECT &quot;</span> + Columns + <span class="string">&quot; FROM &quot;</span> + TableName + <span class="string">&quot;;&quot;</span>;</span><br><span class="line">	<span class="keyword">return</span> SqlQuery;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function">FQueryResultRow <span class="title">UBPFuncLib_FHSQL::GetRowByIndex</span><span class="params">(<span class="keyword">const</span> FQueryResultRows &amp;ResultRows, int32 RowIndex)</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">	<span class="keyword">const</span> FQueryResultRow m_Row = ResultRows.RowsValue[RowIndex];</span><br><span class="line">	<span class="keyword">return</span> m_Row;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>




</li>
</ul>
<h3 id="7-编译项目"><a href="#7-编译项目" class="headerlink" title="7. 编译项目"></a>7. 编译项目</h3><ul>
<li>在<code>Rider</code>内进行项目编译</li>
<li>编译完成，可以在<code>Rider</code>内直接<code>运行</code>启动<code>UE4项目</code></li>
</ul>
<h3 id="8-打包插件"><a href="#8-打包插件" class="headerlink" title="8. 打包插件"></a>8. 打包插件</h3><h4 id="8-1-打包前设置编译工具"><a href="#8-1-打包前设置编译工具" class="headerlink" title="8.1 打包前设置编译工具"></a>8.1 打包前设置编译工具</h4><ul>
<li>前提：如果安装的<code>Visual Studio 2017</code>可能不需要进行这个步骤，直接进入下一步</li>
<li>打包出现<code>RunUAT</code>相关错误信息，再进行此步骤</li>
<li>如果使用的是<code>Visual Studio 2019</code>或<code>Visual Studio 2022</code>或其他版本</li>
</ul>
<ul>
<li>找到<code>RunUAT.bat</code>文件，用<code>记事本</code>打开或编辑</li>
<li>文件位置<code>UE4引擎的安装目录\UE_4.27\Engine\Build\BatchFiles</code></li>
<li><code>编辑 -&gt; 查找</code>，<code>%UATExecutable%</code></li>
<li><code>%UATExecutable% %* %UATCompileArg%</code>修改为<code>%UATExecutable% %* -VS2019=true %UATCompileArg%</code></li>
<li><code>我用的是 VS2022，修改成2022好像不行</code>，但修改成<code>2019</code>就可以正常打包了 </li>
</ul>
<h4 id="8-2-打包MySQL插件"><a href="#8-2-打包MySQL插件" class="headerlink" title="8.2 打包MySQL插件"></a>8.2 打包MySQL插件</h4><ol>
<li>找到<code>Edit</code>或<code>Settings</code></li>
<li>选择<code>plugins</code>进入插件界面</li>
<li>找到插件<code>FH_MySQL</code></li>
<li>可选步骤<code>Edit</code>，进行插件的相关信息的编辑，包括插件的图标</li>
<li>点击<code>Package(打包)</code>，选择打包目录<code>自定义</code></li>
<li>等待打包完成即可</li>
<li>我自己的电脑上的环境打包，完全没有任何<code>Warning</code>和<code>Error</code>，所以理论上打包不存在问题（写这个插件的时候遇到了很多问题，但用我提供的环境库文件和配置步骤，问题都一个个解决了）</li>
</ol>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="mailto:undefined">FHang</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://fhangh.gitee.io/article/605bd1ac.html">https://fhangh.gitee.io/article/605bd1ac.html</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://fhangh.gitee.io" target="_blank">Element</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/fhangh/tags/UnrealEngine/">UnrealEngine</a></div><div class="post_share"><div class="social-share" data-image="https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/Post_Img_mini/postImg_24.jpg" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css"><script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/fhangh/article/cb9854b2.html"><img class="prev-cover" data-lazy-src="https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/Post_Img_mini/postImg_25.jpg" onerror="onerror=null;src='/fhangh/img/404.jpg'"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">UE4 MySQL插件使用</div></div></a></div><div class="next-post pull-right"><a href="/fhangh/article/f7ede91d.html"><img class="next-cover" data-lazy-src="https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/Post_Img_mini/postImg_19.jpg" onerror="onerror=null;src='/fhangh/img/404.jpg'"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">Java基础</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span> 相关推荐</span></div><div class="relatedPosts-list"><div><a href="/fhangh/article/3fadb38f.html" title="UE4联网和多人游戏"><img class="cover" data-lazy-src="https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/Post_Img_mini/postImg_27.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-05-26</div><div class="title">UE4联网和多人游戏</div></div></a></div><div><a href="/fhangh/article/7dd18469.html" title="UE4 RPC"><img class="cover" data-lazy-src="https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/Post_Img_mini/postImg_26.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-05-19</div><div class="title">UE4 RPC</div></div></a></div><div><a href="/fhangh/article/cb9854b2.html" title="UE4 MySQL插件使用"><img class="cover" data-lazy-src="https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/Post_Img_mini/postImg_25.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-03-27</div><div class="title">UE4 MySQL插件使用</div></div></a></div><div><a href="/fhangh/article/80740681.html" title="UE4初始设置及个人使用崩溃记录"><img class="cover" data-lazy-src="https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/Post_Img_mini/postImg_10.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2021-03-13</div><div class="title">UE4初始设置及个人使用崩溃记录</div></div></a></div></div></div></div><div class="aside_content" id="aside_content"><div class="card-widget card-info"><div class="card-content"><div class="card-info-avatar is-center"><img class="avatar-img" data-lazy-src="/fhangh/img/fh.png" onerror="this.onerror=null;this.src='/fhangh/img/friend_404.gif'" alt="avatar"/><div class="author-info__name">FHang</div><div class="author-info__description"></div></div><div class="card-info-data"><div class="card-info-data-item is-center"><a href="/fhangh/archives/"><div class="headline">文章</div><div class="length-num">26</div></a></div><div class="card-info-data-item is-center"><a href="/fhangh/tags/"><div class="headline">标签</div><div class="length-num">10</div></a></div><div class="card-info-data-item is-center"><a href="/fhangh/categories/"><div class="headline">分类</div><div class="length-num">4</div></a></div></div><a class="button--animated" id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/FHangH"><i class="fab fa-github"></i><span>Link To</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/FHangH" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:752972182@qq.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div></div><div class="card-widget card-announcement"><div class="card-content"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div><div class="announcement_content">个人学习笔记</div></div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="card-content"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#UE4-MySQL%E6%8F%92%E4%BB%B6%E5%BC%80%E5%8F%91"><span class="toc-number">1.</span> <span class="toc-text">UE4 MySQL插件开发</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#1-%E9%A1%B9%E7%9B%AE%E7%AE%80%E4%BB%8B"><span class="toc-number">1.0.1.</span> <span class="toc-text">1. 项目简介</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2-%E9%A1%B9%E7%9B%AE%E7%8E%AF%E5%A2%83"><span class="toc-number">1.0.2.</span> <span class="toc-text">2. 项目环境</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#3-%E9%A1%B9%E7%9B%AE%E8%B5%84%E6%BA%90"><span class="toc-number">1.0.3.</span> <span class="toc-text">3. 项目资源</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#3-1-%E8%B5%84%E6%BA%90%E6%96%87%E4%BB%B6%E7%BB%93%E6%9E%84"><span class="toc-number">1.0.3.1.</span> <span class="toc-text">3.1 资源文件结构</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#3-2-%E8%B5%84%E6%BA%90%E9%93%BE%E6%8E%A5"><span class="toc-number">1.0.3.2.</span> <span class="toc-text">3.2 资源链接</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#4-%E9%A1%B9%E7%9B%AE%E5%88%9B%E5%BB%BA"><span class="toc-number">1.0.4.</span> <span class="toc-text">4. 项目创建</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#4-1-%E5%88%9B%E5%BB%BAUE4%E9%A1%B9%E7%9B%AE"><span class="toc-number">1.0.4.1.</span> <span class="toc-text">4.1 创建UE4项目</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#4-2-%E5%88%9B%E5%BB%BA%E6%96%B0%E6%8F%92%E4%BB%B6"><span class="toc-number">1.0.4.2.</span> <span class="toc-text">4.2 创建新插件</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#4-3-%E5%88%9B%E5%BB%BAMySQL-C-%E7%B1%BB"><span class="toc-number">1.0.4.3.</span> <span class="toc-text">4.3 创建MySQL C++类</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#4-3-1-FH-ConnectionObject"><span class="toc-number">1.0.4.3.1.</span> <span class="toc-text">4.3.1 FH_ConnectionObject</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#4-3-2-BPFuncLib-FHSQL"><span class="toc-number">1.0.4.3.2.</span> <span class="toc-text">4.3.2 BPFuncLib_FHSQL</span></a></li></ol></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#5-%E9%A1%B9%E7%9B%AE%E9%85%8D%E7%BD%AE"><span class="toc-number">1.0.5.</span> <span class="toc-text">5. 项目配置</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#5-1-%E5%BC%95%E5%85%A5MySQL%E7%8E%AF%E5%A2%83%E5%BA%93"><span class="toc-number">1.0.5.1.</span> <span class="toc-text">5.1 引入MySQL环境库</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#5-1-1-%E5%AF%BC%E5%85%A5%E7%8E%AF%E5%A2%83%E5%BA%93"><span class="toc-number">1.0.5.1.1.</span> <span class="toc-text">5.1.1 导入环境库</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#5-1-2-%E9%85%8D%E7%BD%AE%E9%A1%B9%E7%9B%AE%E5%B1%9E%E6%80%A7"><span class="toc-number">1.0.5.1.2.</span> <span class="toc-text">5.1.2 配置项目属性</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#5-1-3-%E9%85%8D%E7%BD%AE%E9%A1%B9%E7%9B%AE%E6%96%87%E4%BB%B6"><span class="toc-number">1.0.5.1.3.</span> <span class="toc-text">5.1.3 配置项目文件</span></a></li></ol></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#6-MySQL-C-%E6%96%87%E4%BB%B6"><span class="toc-number">1.0.6.</span> <span class="toc-text">6. MySQL C++文件</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#6-1-MySQL%E8%BF%9E%E6%8E%A5%E5%AF%B9%E8%B1%A1"><span class="toc-number">1.0.6.1.</span> <span class="toc-text">6.1 MySQL连接对象</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#6-2-MySQL%E5%87%BD%E6%95%B0%E5%B7%A5%E5%85%B7%E5%BA%93"><span class="toc-number">1.0.6.2.</span> <span class="toc-text">6.2 MySQL函数工具库</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#7-%E7%BC%96%E8%AF%91%E9%A1%B9%E7%9B%AE"><span class="toc-number">1.0.7.</span> <span class="toc-text">7. 编译项目</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#8-%E6%89%93%E5%8C%85%E6%8F%92%E4%BB%B6"><span class="toc-number">1.0.8.</span> <span class="toc-text">8. 打包插件</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#8-1-%E6%89%93%E5%8C%85%E5%89%8D%E8%AE%BE%E7%BD%AE%E7%BC%96%E8%AF%91%E5%B7%A5%E5%85%B7"><span class="toc-number">1.0.8.1.</span> <span class="toc-text">8.1 打包前设置编译工具</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#8-2-%E6%89%93%E5%8C%85MySQL%E6%8F%92%E4%BB%B6"><span class="toc-number">1.0.8.2.</span> <span class="toc-text">8.2 打包MySQL插件</span></a></li></ol></li></ol></li></ol></li></ol></div></div></div><div class="card-widget card-recent-post"><div class="card-content"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/fhangh/article/3fadb38f.html" title="UE4联网和多人游戏"><img data-lazy-src="https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/Post_Img_mini/postImg_27.jpg" onerror="this.onerror=null;this.src='/fhangh/img/404.jpg'" alt="UE4联网和多人游戏"/></a><div class="content"><a class="title" href="/fhangh/article/3fadb38f.html" title="UE4联网和多人游戏">UE4联网和多人游戏</a><time datetime="2022-05-26T14:04:45.432Z" title="发表于 2022-05-26 22:04:45">2022-05-26</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/fhangh/article/7dd18469.html" title="UE4 RPC"><img data-lazy-src="https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/Post_Img_mini/postImg_26.jpg" onerror="this.onerror=null;this.src='/fhangh/img/404.jpg'" alt="UE4 RPC"/></a><div class="content"><a class="title" href="/fhangh/article/7dd18469.html" title="UE4 RPC">UE4 RPC</a><time datetime="2022-05-19T04:30:00.826Z" title="发表于 2022-05-19 12:30:00">2022-05-19</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/fhangh/article/cb9854b2.html" title="UE4 MySQL插件使用"><img data-lazy-src="https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/Post_Img_mini/postImg_25.jpg" onerror="this.onerror=null;this.src='/fhangh/img/404.jpg'" alt="UE4 MySQL插件使用"/></a><div class="content"><a class="title" href="/fhangh/article/cb9854b2.html" title="UE4 MySQL插件使用">UE4 MySQL插件使用</a><time datetime="2022-03-27T06:49:30.840Z" title="发表于 2022-03-27 14:49:30">2022-03-27</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/fhangh/article/605bd1ac.html" title="UE4 MySQL插件开发"><img data-lazy-src="https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/Post_Img_mini/postImg_24.jpg" onerror="this.onerror=null;this.src='/fhangh/img/404.jpg'" alt="UE4 MySQL插件开发"/></a><div class="content"><a class="title" href="/fhangh/article/605bd1ac.html" title="UE4 MySQL插件开发">UE4 MySQL插件开发</a><time datetime="2022-03-26T07:56:25.807Z" title="发表于 2022-03-26 15:56:25">2022-03-26</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/fhangh/article/f7ede91d.html" title="Java基础"><img data-lazy-src="https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/Post_Img_mini/postImg_19.jpg" onerror="this.onerror=null;this.src='/fhangh/img/404.jpg'" alt="Java基础"/></a><div class="content"><a class="title" href="/fhangh/article/f7ede91d.html" title="Java基础">Java基础</a><time datetime="2021-12-12T07:47:44.788Z" title="发表于 2021-12-12 15:47:44">2021-12-12</time></div></div></div></div></div></div></div></main><footer id="footer" style="background-image: url(https://cdn.jsdelivr.net/gh/FHangH/FHangBlogCDN/Post_Img/postImg_24.jpg)"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2022 By FHang</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><div class="search-dialog__title" id="local-search-title">本地搜索</div><div id="local-input-panel"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div></div><hr/><div id="local-search-results"><div id="local-hits"></div><div id="local-stats"><div class="local-search-stats__hr" id="hr"><span>由</span> <a target="_blank" rel="noopener" href="https://github.com/wzpan/hexo-generator-search" style="color:#49B1F5;">hexo-generator-search</a>
 <span>提供支持</span></div></div></div><span class="search-close-button"><i class="fas fa-times"></i></span></div><div id="search-mask"></div></div><div><script src="https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js"></script><script src="/fhangh/js/utils.js"></script><script src="/fhangh/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js"></script><script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload/dist/lazyload.iife.min.js"></script><script src="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js"></script><script src="/fhangh/js/search/local-search.js"></script><script>var preloader = {
  endLoading: () => {
    document.body.style.overflow = 'auto';
    document.getElementById('loading-box').classList.add("loaded")
  },
  initLoading: () => {
    document.body.style.overflow = '';
    document.getElementById('loading-box').classList.remove("loaded")

  }
}
window.addEventListener('load',()=> {preloader.endLoading()})</script><div class="js-pjax"><script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div><script defer="defer" id="fluttering_ribbon" mobile="false" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/canvas-fluttering-ribbon.min.js"></script><script id="click-heart" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/click-heart.min.js" async="async" mobile="true"></script></div></body></html>